import os, shutil, pydicom
from tkinter.filedialog import askdirectory

path_name = askdirectory()
new_path = path_name + '_new'

if os.path.exists(new_path):
    shutil.rmtree(new_path)
shutil.copytree(path_name, new_path)

for root, dirs, files in os.walk(new_path):
    for file in files:
        if file.endswith('.dcm'):
            dcm_file = os.path.join(root, file)
            dcm = pydicom.read_file(dcm_file)
            
            # dcm[(0x0054, 0x0081)].value = '10'
            
            dcm.save_as(dcm_file)